package csu.jpetstore.jpetstore.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 注意一个事情
 * 所有的图片存在OSS上面, 服务器本地不留存图片, 只留存OSS地址
 */
@Data
@Entity
@Table(name = "item")
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
public class Item implements Serializable {
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @JoinColumn(name = "product_id")
    @ManyToOne
    private Product product;
    @JoinColumn(name = "supplier")
    @ManyToOne
    private Users user;

    private String status;
    private String image;
    private String descn;
    private BigDecimal price;
    private Date addTime;
}
